package micro.controller.userMeun;

import com.alibaba.fastjson.JSONObject;
import micro.pojo.employees;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/sear")
public class userMenu07 {
    @Autowired
    private micro.service.userMeun.userspace userspace;
    @ResponseBody
    @RequestMapping(value = "/searchById",produces = "text/plain;charset=utf-8",method = RequestMethod.GET)
    public String getMemberById(@RequestParam("employeesID") Integer employeesID)
    {
        System.out.println("进入search");
        System.out.println(employeesID);
        employees employees=userspace.sels(employeesID);
        JSONObject result = new JSONObject();
        if(employees!=null) {
            System.out.println(employees.getName());
            result.put("status", "success");
            result.put("employees", employees);
        }
        else
        { result.put("status", "fail");
        }
        return result.toJSONString();
    }
}

